/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package cn.icanci.coupon.service;

import cn.icanci.basic.commonutils.R;
import cn.icanci.coupon.form.BeCouponForm;
import cn.icanci.coupon.form.CouponVO;
import cn.icanci.coupon.form.OptionModule;
import cn.icanci.coupon.model.Coupon;

import java.util.List;

/**
 * @author icanci
 * @date Created in 2021/05/01 11:26
 * @version 1.0
 */
public interface CouponService {

    /**
     * 保存优惠券
     * @param beCouponForm 页面对象
     */
    void addCoupons(BeCouponForm beCouponForm);

    /**
     * 查询所有优惠券
     * @return 返回查询的优惠券
     */
    List<CouponVO> searchAllCoupons();

    /**
     * 插入一条记录
     * @param couponNumber 优惠券号码
     * @param userId 用户唯一id
     * @return
     */
    R insertOneCoupon(String couponNumber, Integer userId);

    /**
     * 更新一条记录
     * @param couponNumber 优惠券号码
     * @param userId 用户唯一id
     * @return
     */
    R updateOneCoupon(String couponNumber, Integer userId);

    /**
     * 查询所有的券的唯一标识
     * @return
     */
    List<OptionModule> searchCouponListUNK();

    /**
     * 查询所有
     * @param unk
     * @return
     */
    List<Coupon> searchOneCouponListByUNK(String unk);

    /**
     * 条件查询
     * @param condition
     * @return
     */
    List<CouponVO> searchAllCouponsByCondition(String condition);

    /**
     * 根据时间查询
     * @return
     */
    List<CouponVO> searchAllCouponsLimitTime();

    /**
     * 查询一个用户的优惠券数据
     * @param userId
     * @return
     */
    R queryUserCoupons(Integer userId);

    /**
     * 查询一个用户的优惠券数据
     * @param userId
     * @param startCity
     * @param endCity
     * @return
     */
    R queryUserCouponsByTargetSECity(Integer userId, String startCity, String endCity);

    /**
     * 查询用户的一条优惠券信息
     * @param couponNumber
     * @param userId
     * @return
     */
    R queryOneCoupon(String couponNumber, Integer userId);
}
